/**
 * @Author: 陈瑞鹏
 * @Date:   2022-12-08 11:03:00
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2022-12-08 11:16:52
 */
import BaseGameLayer from "../libs/core/BaseGameLayer";
import { SceneManager } from "../libs/manager/SceneManager";

const { ccclass, property } = cc._decorator
@ccclass
export default class tipLayer extends BaseGameLayer {

  @property({ type: cc.Label, tooltip: "提示文字" })
  tipTxt: cc.Label = null;

  onEnable(): void {
    super.onEnable();
    this.scheduleOnce(() => {
      SceneManager.getInstance().removeLayer("tipLayer");
    }, 1)
  }

  public onDisable(): void {
    super.onDisable();
    this.unscheduleAllCallbacks();
  }

  protected onDataChanged(): void {
    super.onDataChanged();
    this.tipTxt.string = this.customData;
  }
}